package com.xms.core.data;

/**
 * <p>
 * 实体数据集合
 * </p>
 *
 * @author migo
 * @since 2021/10/7
 */
public class EntityCollection extends DataTable{

    public void EntityCollection(String name) {
        this.setName(name);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private String name;

    public Entity get(int index){
        Entity entity = new Entity(this.name);
        int i = 0;
        for (String k : this.getColumns()){
            entity.setValue(k, this.getRows().get(index)[i]);
            i++;
        }
        return entity;
    }
}
